using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BaHuan.Common;
using BaHuan.Entities;
using BaHuan.DataLayer;
/*
 * There are many processes that handle the flows of data
 * we call them business logic of a program.
 * For each of business logic process we create a class 
 * that handle for that process
 * 
 * */
namespace BaHuan.BusinessLayer
{
	
	public class PhieuXuatHangManagement
	{
	
		public ResultObj SaveNewPhieuXuatHang(PhieuXuatHang phieuxuathang)
        		{
			ResultObj result = new ResultObj();
			phieuxuathang.Id = -1;
			PhieuXuatHangDAO phieuxuathangDAO = new PhieuXuatHangDAO();
			result = phieuxuathangDAO.SavePhieuXuatHang(phieuxuathang);
			
			return result;
		}
		
		public ResultObj UpdatePhieuXuatHang(PhieuXuatHang phieuxuathang)
        		{
			ResultObj result = new ResultObj();
			PhieuXuatHangDAO phieuxuathangDAO = new PhieuXuatHangDAO();
			result = phieuxuathangDAO.UpdatePhieuXuatHang(phieuxuathang);
			
			return result;
		}
		
		public ResultObj DeletePhieuXuatHang(PhieuXuatHang phieuxuathang)
        		{
			ResultObj result = new ResultObj();
			PhieuXuatHangDAO phieuxuathangDAO = new PhieuXuatHangDAO();
			result = phieuxuathangDAO.DeletePhieuXuatHang(phieuxuathang);
			
			return result;
		}
		
		public ResultObj GetAllPhieuXuatHang( )
        		{
			ResultObj result = new ResultObj();
			PhieuXuatHangDAO phieuxuathangDAO = new PhieuXuatHangDAO();
			result = phieuxuathangDAO.GetAllPhieuXuatHang();
			
			return result;
		}

        public ResultObj GetAllPhieuXuatHangLien3()
        {
            ResultObj result = new ResultObj();
            PhieuXuatHangDAO phieuxuathangDAO = new PhieuXuatHangDAO();
            result = phieuxuathangDAO.GetAllPhieuXuatHangLien3();

            return result;
        }
		
		public ResultObj GetPhieuXuatHangById(PhieuXuatHang phieuxuathang)
        		{
			ResultObj result = new ResultObj();
			PhieuXuatHangDAO phieuxuathangDAO = new PhieuXuatHangDAO();
			result = phieuxuathangDAO.GetAllPhieuXuatHangByID(phieuxuathang);
			
			return result;
		}
					
	}
}
